#include <gtk/gtk.h>

#include "UI_Dnw.h"

GtkWidget* mainWindow = NULL;
GtkWidget* btnStartBorn = NULL;

static void onBtnBornClicked(GtkWidget* btn, gpointer data)
{
    
}

static void onDestory(GtkWidget* widget, gpointer data) {
	gtk_main_quit();
}

static void initializeGui()
{
    mainWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    gtk_window_set_default_geometry(GTK_WINDOW(mainWindow), 640, 480);
    btnStartBorn = gtk_button_new_with_label("born");
    g_signal_connect(G_OBJECT(btnStartBorn), "clicked", G_CALLBACK(onBtnBornClicked), NULL);
    g_signal_connect(G_OBJECT(mainWindow), "destroy", G_CALLBACK(onDestory), NULL);
    gtk_container_add(GTK_CONTAINER(mainWindow), btnStartBorn);
}

static void showGui()
{
    gtk_widget_show(btnStartBorn);
    gtk_widget_show(mainWindow);
}

static void hideGui()
{
}

static void finalizeGui()
{
    
}

void StartGui(int* argc, char* *argv[])
{
    gtk_init(argc, argv);
    initializeGui();
    showGui();
    gtk_main();    
    hideGui();
    finalizeGui();
} 
